/// The archive type - provided by the archive library.
#ifndef PRYN_TYPES_ARCHIVE_H
#define PRYN_TYPES_ARCHIVE_H

#if __cplusplus
extern "C" {
#endif

typedef struct PrynArchive PrynArchive;
typedef struct PrynArchiveFile PrynArchiveFile;
typedef enum PrynArchiveFileFlags PrynArchiveFileFlags;

#include <pryn/string.h>
#include <pryn/platform.h>
#include <pryn/type.h>

struct PrynArchive
{
	PrynString name; /// Name of the archive, such as the filename.
	PrynString volumeIdentifier; /// Volume identifier or empty for none.
	void *proprietary; /// Proprietary information used by the archiver.
};

/// An individual file within an archive.
struct PrynArchiveFile
{
	PrynString name; /// Name of the file, including any path.
	PrynArchiveFileFlags flags; /// Combination of flags for the file.
	uint64_t size; /// Uncompressed file size in bytes.
	uint64_t archiveSize; /// Size of the file within the archive in bytes.
	PrynTime modifiedTime; /// Time when the file was last modified, or 0 for not valid.
};

/// Bit mask of flags for a file.
enum PrynArchiveFileFlags
{
	PrynArchiveFileFlags_None = 0, /// No flags specified.
	PrynArchiveFileFlags_Directory = 1 << 0, /// This file is actually a directory.
	PrynArchiveFileFlags_Hidden = 1 << 1, /// This file should be hidden from normal view.
	PrynArchiveFileFlags_ReadOnly = 1 << 2, /// Writing to the file should not be normally possible.
	PrynArchiveFileFlags_System = 1 << 3, /// The file is important to the operating system.
	PrynArchiveFileFlags_Archive = 1 << 4, /// This is an archive of another file.
};

#if __cplusplus
}
#endif

#endif /* PRYN_ARCHIVE_H */
